/*
 * ControllerFactory.cpp - Grupo 5 - Prog. Avanzada 2011
 *
 *  Javier Dominguez - 4.901.161-6
 *  Marcelo Parada - 1.977.094-9
 *  Rodrigo Ruiz - 4.481.611-2
 *  Maximiliano Silvera - 4.106.938-6
 */

#include "ControllerFactory.h"

ControllerFactory::ControllerFactory()
{
	compartirPistaAlbumController = new CCompartirPistaAlbum();

	compartirTemaSingleController = new CCompartirTemaSingle();

	consultarInformacionTemaController = new CConsultarInformacionTema();

	eliminarTemaController = new CEliminarTema();

	etiquetarElementoController = new CEtiquetarElemento();

	registroUsuarioController = new CRegistroUsuario();

	reproducirTemaController = new CReproducirTema();
}

ControllerFactory* ControllerFactory::instance;

ControllerFactory* ControllerFactory::getInstance()
{
	if(instance == NULL)
	{
		instance = new ControllerFactory();
	}

	return instance;
}

ICompartirPistaAlbum* ControllerFactory::getCompartirPistaAlbumController() const
{
    return compartirPistaAlbumController;
}

ICompartirTemaSingle* ControllerFactory::getCompartirTemaSingleController() const
{

    return compartirTemaSingleController;
}

IConsultarInformacionTema* ControllerFactory::getConsultarInformacionTemaController() const
{
    return consultarInformacionTemaController;
}

IEliminarTema* ControllerFactory::getEliminarTemaController() const
{
    return eliminarTemaController;
}

IEtiquetarElemento* ControllerFactory::getEtiquetarElementoController() const
{
    return etiquetarElementoController;
}

IRegistroUsuario* ControllerFactory::getRegistroUsuarioController() const
{
    return registroUsuarioController;
}

IReproducirTema* ControllerFactory::getReproducirTemaController() const
{
    return reproducirTemaController;
}

ControllerFactory::~ControllerFactory()
{
	delete instance;

	delete compartirPistaAlbumController;

	delete compartirTemaSingleController;

	delete consultarInformacionTemaController;

	delete eliminarTemaController;

	delete etiquetarElementoController;

	delete registroUsuarioController;

	delete reproducirTemaController;
}

